using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Impact.Infrastructure.Plugins
{
    /// <summary>
    /// interface for all Impact Plugins to implement.
    /// </summary>
    public interface IImpactPlugin
    {
        /// <summary>
        /// Identifer that can uniquely identify the class, not the instance.
        /// Create a static or const Guid literal and return it.
        /// </summary>
        Guid PluginId
        {
            get;
        }

        /// <summary>
        /// textual description of this plugin.  used in the Administration screens
        /// </summary>
        string Name
        {
            get;
        }

        /// <summary>
        /// a list of parameters that are editable by the Admin in the Administration screens,
        /// and is used when the plugin is rendered.  The values are stored on the page where a plugin is 
        /// assigned.  The key is a unique name for the parameter, and the value is the Type the parameter is.
        /// </summary>
        Dictionary<string, PluginParameter> Parameters
        {
            get;
        }

        /// <summary>
        /// Admin interface for this plugin that defines how the Admin screen edits the parameters
        /// for this plugin.
        /// </summary>
        /// <remarks>It is possible to return null for the Admin property.  If this happens, the Admin
        /// screen will make assumptions about editing parameters.</remarks>
        IPluginAdmin Admin
        {
            get;
        }

        /// <summary>
        /// Renders the plugin's controls using values that were defined in the Admin interface per instance
        /// of the plugin.
        /// </summary>
        /// <param name="container">the Control object that will be the parent to any controls this plugin will create</param>
        /// <param name="parameterValues">The values that were defined for the parameters returned from the
        /// ParameterNames property.  The key is the parameter name as defined in the ParameterNames property,
        /// the value is the value of the parameter as defined in the Admin interface.</param>
        /// <returns>a new control that contains the content for this plugin.  this control is added to the
        /// page the plugin was added to, in the location set.</returns>
        void Render(Control container, Dictionary<string, PluginParameter> parameterValues);


    }


}
